function formatDay(value) {
  if (!value) {
    value = new Date();
  }
  let date = new Date(value);
  let year = date.getFullYear(); //年
  let month = (date.getMonth() + 1).toString().padStart(2, "0"); //月
  let day = date.getDate().toString().padStart(2, "0"); //日;
  // let format = year + "-" + month + "-" + day;
  let h = date.getHours().toString().padStart(2, "0");
  let m = date.getMinutes().toString().padStart(2, "0");
  let s = date.getSeconds().toString().padStart(2, "0");
  let format = `${year}-${month}-${day} ${h}:${m}:${s}`;

  return format;
}

export default formatDay;
